/*
Copyright [2023] [fuwen_soft]
*/
package vip.xiaonuo.sys.modular.sysappinfofeatures.controller;

import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import vip.xiaonuo.core.pojo.page.PageResult;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import vip.xiaonuo.core.annotion.version.AdminVersionSwagger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import vip.xiaonuo.sys.core.msg.Result;
import vip.xiaonuo.sys.modular.sysappinfofeatures.entity.SysAppInfoFeatures;
import vip.xiaonuo.sys.modular.sysappinfofeatures.param.SysAppInfoFeaturesParam;
import vip.xiaonuo.sys.modular.sysappinfofeatures.service.SysAppInfoFeaturesService;

import javax.annotation.Resource;
import java.util.List;

import static vip.xiaonuo.sys.core.msg.ResultUtils.success;

/**
 * APP特色内容控制器
 *
 * @author yanwei
 * @date 2023-03-21 12:07:26
 */
@RestController
@Api(tags = "后台管理 APP特色内容 相关APIS")
@AdminVersionSwagger
public class SysAppInfoFeaturesController {

    @Resource
    private SysAppInfoFeaturesService sysAppInfoFeaturesService;

    /**
     * 查询APP特色内容
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoFeatures/page")
    @BusinessLog(title = "APP特色内容_查询", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP特色内容_查询")
    public Result<PageResult<SysAppInfoFeatures>> page(SysAppInfoFeaturesParam sysAppInfoFeaturesParam) {
        PageResult<SysAppInfoFeatures> page = sysAppInfoFeaturesService.page(sysAppInfoFeaturesParam);
        return success(page);
    }

    /**
     * 添加APP特色内容
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @PostMapping("/sysAppInfoFeatures/add")
    @BusinessLog(title = "APP特色内容_增加", opType = LogAnnotionOpTypeEnum.ADD)
    @ApiOperation("APP特色内容_增加")
    public Result add(@RequestBody @Validated(SysAppInfoFeaturesParam.add.class) SysAppInfoFeaturesParam sysAppInfoFeaturesParam) {
            sysAppInfoFeaturesService.add(sysAppInfoFeaturesParam);
        return success();
    }

    /**
     * 删除APP特色内容，可批量删除
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @PostMapping("/sysAppInfoFeatures/delete")
    @BusinessLog(title = "APP特色内容_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    @ApiOperation("APP特色内容_删除")
    public Result delete(@RequestBody @Validated(SysAppInfoFeaturesParam.delete.class) List<SysAppInfoFeaturesParam> sysAppInfoFeaturesParamList) {
            sysAppInfoFeaturesService.delete(sysAppInfoFeaturesParamList);
        return success();
    }

    /**
     * 编辑APP特色内容
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @PostMapping("/sysAppInfoFeatures/edit")
    @BusinessLog(title = "APP特色内容_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    @ApiOperation("APP特色内容_编辑")
    public Result edit(@RequestBody @Validated(SysAppInfoFeaturesParam.edit.class) SysAppInfoFeaturesParam sysAppInfoFeaturesParam) {
            sysAppInfoFeaturesService.edit(sysAppInfoFeaturesParam);
        return success();
    }

    /**
     * 查看APP特色内容
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoFeatures/detail")
    @BusinessLog(title = "APP特色内容_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
    @ApiOperation("APP特色内容_查看")
    public Result<SysAppInfoFeatures> detail(@Validated(SysAppInfoFeaturesParam.detail.class) SysAppInfoFeaturesParam sysAppInfoFeaturesParam) {
        SysAppInfoFeatures detail =   sysAppInfoFeaturesService.detail(sysAppInfoFeaturesParam);
        return success(detail);
    }

    /**
     * APP特色内容列表
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoFeatures/list")
    @BusinessLog(title = "APP特色内容_列表", opType = LogAnnotionOpTypeEnum.QUERY)
    @ApiOperation("APP特色内容_列表")
    public Result<List<SysAppInfoFeatures>> list(SysAppInfoFeaturesParam sysAppInfoFeaturesParam) {
        List<SysAppInfoFeatures> list  =   sysAppInfoFeaturesService.list(sysAppInfoFeaturesParam);
        return success(list);
    }

    /**
     * 导出系统用户
     *
     * @author yanwei
     * @date 2023-03-21 12:07:26
     */
    @Permission
    @GetMapping("/sysAppInfoFeatures/export")
    @BusinessLog(title = "APP特色内容_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
    @ApiOperation("APP特色内容_导出")
    public void export(SysAppInfoFeaturesParam sysAppInfoFeaturesParam) {
        sysAppInfoFeaturesService.export(sysAppInfoFeaturesParam);
    }

}
